<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%@ page language="java" import="java.util.*"%>
<%@ page import="elibrary.DaoConnection" %>
<%@ include file="config.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Request Book</title>
    </head>
    <body>

        <%

        //the feilds are fetched and updated in the database

        String fname=request.getParameter("fname");
        String lname=request.getParameter("lname");
        String email=request.getParameter("email");
        String address=request.getParameter("address");

        Statement stmt = null;
        ResultSet results = null;
        try{
                 Connection con=DaoConnection.getcon(connectURL, DBuser, DBpass);
                 Statement st=con.createStatement();
                 String str="UPDATE USERS SET FNAME='"+fname+"',lname='"+lname+"',email='"+email+"',address='"+address+"' WHERE username ='roshan'";
             st.executeUpdate(str);
                 out.println("profile updated");
		
         }catch(Exception e){
             out.println(e.toString());
             out.println("ERROR!!");
             e.printStackTrace();
         }
        %>

    </body>
</html>